In the recent development of transistors, metal are used for forming contact plugs and metal gates. Contact plugs are used for connecting to the source and drain regions and the gates of transistors. The source/drain contact plugs are typically connected to source/drain silicide regions, which are formed by depositing a metal layer, and then performing an anneal to react the metal layer with the silicon in the source/drain regions. The gate contact plugs are used for connecting to the metal gates.
The formation of metal gates may include forming dummy gate stacks, removing the dummy gate stacks to form openings, filling a metallic material into the openings, and performing a planarization to remove excess metallic material in order to form the metal gates. The metal gates are then recessed to form recesses, and dielectric hard masks are filled into the recesses. When the gate contact plugs are formed, the hard masks are removed, so that the gate contact plugs may contact the metal gates.